{include file='../public_btn.html'}
<div class="html-box">
    <form class="cond-form clear" action="#!yunbuy/index" onsubmit="return xForm.submit(this)">
        <div class="f-unit">
            <select name="k" id="k">
                <option value="title" {if $k eq 'title'}selected{/if}>商品名称</option>
                {if $business_power}
                <option value="b.bus_name" {if $k eq 'b.bus_name'}selected{/if}>商家名称</option>
                {/if}
                <option value="buy_id" {if $k eq 'buy_id'}selected{/if}>ID</option>
            </select>
            <input id="q" class="form-i w160 sitem" name="q" value="{$q}" type="text">
            <select name="status">
                <option value="">-{$L.unit_yun}状态-</option>
                <option value="1" {if $status eq 1}selected{/if}>进行中</option>
                <option value="2" {if $status eq 2}selected{/if}>已开奖</option>
                <option value="3" {if $status eq 3}selected{/if}>待揭晓</option>
                <option value="4" {if $status eq 4}selected{/if}>期数已满</option>
            </select>
            <select name="type">
                <option value="">-{$L.unit_yun}类型-</option>
                <option value="1" {if $type eq 1}selected{/if}>普通</option>
                <option value="2" {if $type eq 2}selected{/if}>{$L.unit_pay_points}</option>
                {if $smarty.const.YUN_GO}
                <option value="3" {if $type eq 3}selected{/if}>{$L.unit_go_buy}</option>
                {/if}
            </select>
            <select name="posid">
                <option value="">-推荐-</option>
                <option value="1" {if $posid eq 1}selected{/if}>是</option>
                <option value="99" {if $posid eq 99}selected{/if}>否</option>
            </select>
            <select name="publish">
                <option value="">发布来源</option>
                <option value="1" {if $publish eq 1} selected{/if}>后台发布</option>
                <option value="2" {if $publish eq 2} selected{/if}>商家发布</option>
            </select>
            <span style="float: left;">单次购买价格</span><input class="form-i w160 sitem" name="price" value="{$price}" type="text">
            <select name="limit">
                <option value="">-是否限购-</option>
                <option value="1" {if $limit eq 1}selected{/if}>是</option>
                <option value="2" {if $limit eq 2}selected{/if}>否</option>
            </select>
            <button type="submit" style="margin-left:10px; margin-top:1px" class="uiBtn BtnBlue">搜索</button>
        </div>
    </form>

    <table class="list">
        <thead>
            <tr>
                <th class="w30">排序</th>
                <th class="w30">ID</th>
                <th align="left">商品名称</th>
                <th class="w120">价值/总需/单次/期数</th>
                <th class="w120">已参与/总需人数</th>
                <th class="w80">点击</th>
                <th class="w40">推荐</th>
                <th class="w80">状态</th>
                <th class="w80">是否显示</th>
                <th class="w80">操作</th>
            </tr>
        </thead>
        <tbody>
            {foreach from=$data.list item=m}
            <tr>
                <td align='center'><input class="form-i-s w30" name="listorders[{$m.buy_id}]" value="{$m.listorders}" type="text"></td>
                <td class='id' align='center'>{$m.buy_id}</td>
                <td>
                    <a href="{$smarty.const.RootUrl}yunbuy/detail/{$m.buy_id}" target="_blank">(第{$m.qishu}期) {$m.title}</a>
                    {if $m.type eq 2} <span class="mark">赠品专区</span>{/if}
                    {if $m.gobuy eq 1} <span class="mark">{$L.unit_go_buy}商品</span>{/if}
                    {if $m.bus_name}
                    <p><span style="color:#f00" class="">商家：{$m.bus_name}； 平台分佣：{$m.bus_money_manage|price_format}</span></p>
                    {/if}
                </td>
                <td align="center" nowrap>
                    {if $m.gobuy eq 1}
                    购买价格：{$m.custom_price|price_format}
                    {else}
                    {$m.true_price|floor} / {$m.need_num} / {$m.price|floor} / {$m.max_qishu}
                    {/if}
                </td>
                <td align="center"><b class="c-orange">{$m.buy_num}</b> / {$m.need_num}</td>
                <td align="center">{$m.goods_click}</td>
                <td align='center'>
                    {if $m.posid == 1}
                    <a href="javascript:;" onclick="main.chang_status('{$m.buy_id}','yunbuy','posid','buy_id')" class="c-green" title="点击设为不推荐">是</a>
                    {else}
                    <a href="javascript:;" onclick="main.chang_status('{$m.buy_id}','yunbuy','posid','buy_id')" class="c-red" title="点击设为推荐">否</a>
                    {/if}
                </td>
                <td align="center">{$m.status}</td>
                <td align="center">
                    {if $m.is_off==1}
                	<a href='javascript:;' class='c-red' >已下架</a>
                	{else}
                	{if $m.is_show}
                    <a href='javascript:;' class='c-green' onclick='main.chang_status("{$m.buy_id}","yunbuy","is_show","buy_id")' title='点击设为隐藏'>显示</a>
                    {else}
                    <a href='javascript:;' class='c-red' onclick='main.chang_status("{$m.buy_id}","yunbuy","is_show","buy_id")' title='点击设为显示'>隐藏</a>
                    {/if}
                	{/if}
				</td>
                <td class='opera' align='center' nowrap>
					<a href='javascript:;' onclick="main.confirm_off('yunbuy/off','{$m.buy_id}')" class='c-red' title='点击设为下架'>下架</a>
                    <a href='#!yunbuy/edit/?id={$m.buy_id}&com=xshow|编辑{$L.unit_yun}（{$m.buy_id}）' class='iconfont icon-a' title='编辑'>&#xe603;</a>
                    <a href='javascript:;' onclick="main.confirm_del('yunbuy/del','{$m.buy_id}')" class='iconfont icon-a' title='删除'>&#xe606;</a>
                </td>
            </tr>
            {/foreach}
        </tbody>
    </table>
    <div class="foot-btn">
        <div class="pager r">{$page}</div>
        <button type="button" class="uiBtn BtnGreen" onclick="main.batch_order('formlist','order','yunbuy','listorders','buy_id')">更新排序</button>
    </div>

</div>

